import { PlanData } from './types';

// 模拟API响应数据
const mockPlanData: PlanData = {
  planInfo: {
    planName: "2025年基础设施研发中心投产规划(2025-05-01~2025-06-30)",
    planCode: "GH-JC-20250301",
    department: "基础设施研发中心",
    implementationTime: "2025.05.01至2025.06.30",
    summary: "本次投产规划主要涉及核心应用和基础运营相关系统的版本更新..."
  },
  planDetails: [
    {
      team: "核心应用开发团队",
      systemName: "LI07 对公户口系统",
      isReported: "申报投产规划",
      contactPerson: {
        name: "武嘉",
        code: "00010946"
      },
      responsiblePerson: {
        name: "武嘉",
        code: "00010946"
      },
      status: "草稿"
    },
    {
      team: "核心应用开发团队",
      systemName: "LW35 核心账务系统",
      isReported: "申报投产规划",
      contactPerson: {
        name: "余波",
        code: "00011196"
      },
      responsiblePerson: {
        name: "余波",
        code: "00011196"
      },
      status: "草稿"
    },
    {
      team: "基础运营开发团队",
      systemName: "LC50 柜面综合业务系统",
      isReported: "申报投产规划",
      contactPerson: {
        name: "潘健",
        code: "00011128"
      },
      responsiblePerson: {
        name: "潘健",
        code: "00011128"
      },
      status: "草稿"
    },
    {
      team: "基础运营开发团队",
      systemName: "LC52 柜面通用综合网关",
      isReported: "申报投产规划",
      contactPerson: {
        name: "徐宁",
        code: "80234624"
      },
      responsiblePerson: {
        name: "徐宁",
        code: "80234624"
      },
      status: "草稿"
    },
    {
      team: "基础运营开发团队",
      systemName: "LC53 影像系统",
      isReported: "申报投产规划",
      contactPerson: {
        name: "邓可为",
        code: "80245460"
      },
      responsiblePerson: {
        name: "邓可为",
        code: "80245460"
      },
      status: "草稿"
    }
  ]
};

// 获取投产规划数据
export const fetchPlanData = async (): Promise<PlanData> => {
  // 模拟API请求延迟
  return new Promise((resolve) => {
    setTimeout(() => {
      resolve(mockPlanData);
    }, 500);
  });
};

// 保存投产规划摘要
export const savePlanSummary = async (summary: string): Promise<boolean> => {
  // 模拟API请求延迟
  return new Promise((resolve) => {
    setTimeout(() => {
      console.log('保存投产规划摘要:', summary);
      resolve(true);
    }, 500);
  });
};

// 提交投产规划审核
export const submitPlanForReview = async (summary: string): Promise<boolean> => {
  // 模拟API请求延迟
  return new Promise((resolve) => {
    setTimeout(() => {
      console.log('提交投产规划审核:', summary);
      resolve(true);
    }, 500);
  });
}; 